package com.sunwayworld.basemodule.basedata.knowledgelibrary.resource;

import com.alibaba.fastjson.JSONObject;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;
import com.sunwayworld.module.item.file.bean.CoreFileBean;
import org.springframework.web.bind.annotation.*;

import com.sunwayworld.basemodule.basedata.knowledgelibrary.bean.LimsKnowledgelibraryBean;
import com.sunwayworld.basemodule.basedata.knowledgelibrary.service.LimsKnowledgelibraryService;
import com.sunwayworld.framework.support.base.resource.GenericResource;
import com.sunwayworld.framework.support.choosable.resource.GenericChoosableResource;

@RequestMapping("/secure/baseline/basedata/knowledgelibrarys")
public interface LimsKnowledgelibraryResource extends GenericResource<LimsKnowledgelibraryService, LimsKnowledgelibraryBean, Long>, GenericChoosableResource<LimsKnowledgelibraryService, LimsKnowledgelibraryBean, Long> {

    @PostMapping(value = "/set-activestatus")
    JSONObject setActiveStatus(RestJsonWrapperBean jsonWrapperBean);

    @PostMapping(value = "/save-authorizedpeople")
    JSONObject saveAuthorizedPeople(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-homepagedata")
    JSONObject refreshHomePageData(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-knowledgelibrary")
    JSONObject refreshKnowledgeLibraryData(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-remarknote")
    JSONObject refreshRemarkNoteData(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-experimentinformation")
    JSONObject refreshExperimentInformationData(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-todo")
    JSONObject refreshToDoData(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-notification")
    JSONObject refreshNotificationData(RestJsonWrapperBean jsonWrapperBean);

    @RequestMapping(value = "/refresh-menuname")
    JSONObject refreshMenuNameData(RestJsonWrapperBean jsonWrapperBean);

    @PostMapping(value = "/insert/remarknote")
    JSONObject insertRemarkNote(@RequestBody JSONObject data);

    @PostMapping(value = "/delete/remarknote")
    JSONObject deleteRemarkNote(@RequestBody JSONObject data);

    @PostMapping(value = "/update/remarknote")
    JSONObject updateRemarkNote(@RequestBody JSONObject data);

    @Log(value = "知识库文件下载", type = LogType.SELECT)
    @RequestMapping(value = "/{rowId}/core-file", method = RequestMethod.POST)
    CoreFileBean selectCoreFileByRowId(@PathVariable Long rowId);
}
